Add example transaction golden test for each era#5799
Merged
Conversation
koslambrou
commented
May 5, 2026
koslambrou
commented
May 5, 2026
koslambrou
commented
May 5, 2026
Contributor
Author
|
I wasn't 100% sure where to call A future PR would be required to organize the test modules so that each era follows the same pattern. |
145dd64 to
1515f46
Compare
lehins
reviewed
May 6, 2026
1515f46 to
731c4a9
Compare
2969def to
3ca2a75
Compare
615523d to
4c9b2c2
Compare
10 tasks
4d6655d to
8f6be2b
Compare
667c4cd to
9cbe932
Compare
d726379 to
e00b05e
Compare
e00b05e to
06606e0
Compare
lehins
approved these changes
May 13, 2026
Collaborator
lehins
left a comment
There was a problem hiding this comment.
Awesome work!
Thank you!
Collaborator
|
Needs a rebase and conflicts resolved, but other than that it is ready to go. 👍 |
…c` in cardano-ledger-core:testlib and generate the golden example transactions for each era. `goldenExampleEraTxCborSpec` allows us to generate a `Spec` for generating a `golden/tx.cbor` golden file out of some `Tx` provided as a parameter. Then, for each era's test-suite, we call this function to generate the golden file using the example transaction we have defined for each era. We also extended `EraTest` so that we don't need to manually call `getDataFileName` in order to get the fullpath for each era's cabal project. We also create new `Binary.Golden` modules for Mary and Babbage (previously they reused Allegra's and Alonzo's respectively, which used the wrong era's example transactions). Additionally, fix `exampleDijkstraBasedTopTx` to not add PlutusV4 scripts to `scriptTxWitsL`: PlutusV4 is not included in Dijkstra's `transaction_witness_set` CDDL, so those scripts were silently dropped during serialization, causing a roundtrip failure.
06606e0 to
88e4fda
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add Test.Cardano.Ledger.Core.Binary.Golden.goldenExampleEraTxCborSpec in cardano-ledger-core:testlib and generate the golden example transactions for each era.
goldenExampleEraTxCborSpecallows us to generate aSpecforgenerating a
golden/tx.cborgolden file out of someTxprovided as aparameter.
Then, for each era's test-suite, we call this function to generate the
golden file using the example transaction we have defined for each era.
We also extended
EraTestso that we don't need to manually callgetDataFileNamein order to get the fullpath for each era's cabalproject.
We also create new
Binary.Goldenmodules for Mary and Babbage (previouslythey reused Allegra's and Alonzo's respectively).
Additionally, fix
exampleDijkstraBasedTopTxto not add PlutusV4 scriptsto
scriptTxWitsL: PlutusV4 is not included in Dijkstra'stransaction_witness_setCDDL, so those scripts weresilently dropped during serialization, causing a roundtrip failure.
Checklist
CHANGELOG.mdfiles updated for packages with externally visible changes.NOTE: New section is never added with the code changes. (See RELEASING.md).
.cabalandCHANGELOG.mdfiles when necessary, according to theversioning process.
.cabalfiles updated when necessary.NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
scripts/fourmolize.sh).scripts/cabal-format.sh).scripts/gen-cddl.sh)hie.yamlupdated (usescripts/gen-hie.sh).